/**
 * https://leetcode.cn/problems/house-robber/submissions/561796244/
 * 198. 打家劫舍
 * medium 陈贝纯 2024.09.05
 * 经典线性
 */

class Solution {
public:
    int dp[110];
    int rob(vector<int>& nums) {
        for(int i=0;i<nums.size();++i)
        dp[i+2]=max(dp[i+1],dp[i]+nums[i]);
        return dp[nums.size()+1];
    }
};